<script type="text/javascript">
<!--
{literal}
    $(document).ready(function(){
        $('#paraclinicalType').click(function(){
            $("#nextServiceFrm input[name='serviceItemId']").attr('disabled', 'disabled');
            $("#nextServiceFrm input[name='paraclinicalItemId\[\]']").removeAttr('disabled');
            $("#nextServiceFrm input[name='paraclinicalItemId\[\]']").attr('checked', 'checked');
        });
        $('#serviceType').click(function(){
            $("#nextServiceFrm input[name='serviceItemId']").removeAttr('disabled');
            $("#nextServiceFrm input[name='serviceItemId']:first").attr('checked','checked');
            $("#nextServiceFrm input[name='paraclinicalItemId\[\]']").attr('disabled', 'disabled');
        });
        {/literal}
	        {if !empty($serviceModelList)}
	        $('#nextServiceFrm #serviceType').attr('checked', 'checked');
	        $("#nextServiceFrm input[name='serviceItemId']:first").attr('checked','checked');
	        {else}
	        $('#nextServiceFrm #paraclinicalType').attr('checked', 'checked');
	        $("#nextServiceFrm input[name='paraclinicalItemId\[\]']").attr('checked', 'checked');
	        {/if}
        {literal}
    });
{/literal}
//-->
</script>
<div>
    <form id="nextServiceFrm">
        <span class="formAlertMsg" id="nextMsg" style="display: none;"></span>
        {if !empty($serviceModelList)}
            <div class="group_title"><input type="radio" name="itemType" id="serviceType" value="service">{translate}Examination-Surgery{/translate}</div>
            {foreach from=$serviceModelList item=itemModel}
            <div style="padding-left: 20px;">
                <table>
                    <tbody>
                        <tr valign="top">
                            <td style="width: 20px;"><input type="radio" name="serviceItemId" value="{$itemModel->getTicketItemId()}"></td>
                            <td style="width: 200px;">{$itemModel->getServiceName()}</td>
                            <td style="padding-left: 10px;"><span class="label">{$itemModel->getRoomName()}</span></td>
                        </tr>
                    </tbody>
                </table>
            </div>
            {/foreach}
        {/if}
        {if !empty($paraclinicalModelList)}
            <div class="group_title"><input type="radio" name="itemType" id="paraclinicalType" value="paraclinique">{translate}Paraclinique{/translate}</div>
            {foreach from=$paraclinicalModelList item=itemModel}
            <div style="padding-left: 20px;">
                <table>
                    <tbody>
                        <tr valign="top">
                            <td style="width: 20px;"><input type="checkbox" name="paraclinicalItemId[]" value="{$itemModel->getTicketItemId()}"></td>
                            <td style="width: 200px;">{$itemModel->getServiceName()}</td>
                            <td style="padding-left: 10px;"><span class="label">{$itemModel->getRoomName()}</span></td>
                        </tr>
                    </tbody>
                </table>
            </div>
            {/foreach}
        {/if}
        {if empty($serviceModelList) && empty($paraclinicalModelList)}
            <div style="padding: 10px 0px;">{translate}There are no other undone services in the ticket. You could finish the ticket or add some new services to continue.{/translate}</div>
        {/if}
    </form>
</div>